export default [
  {
    // name:'main', 若有默认子路由，在路由配置项中就不用给父级路由设置name，否则会有一个警告
    path:'/',
    component:()=>import('@/pages/Main'),
    children:[
      {
        name:'home',
        path:'home',
        // 懒加载
        component:()=>import('@/pages/Main/Home')
      },
      {
        name:'user',
        path:'user',
        component:()=>import('@/pages/Main/User')
      },
      {
        name:'product',
        path:'product',
        component:()=>import('@/pages/Main/Product')
      },
      {
        name:'page1',
        path:'page1',
        component:()=>import('@/pages/Main/Other/Page1')
      },
      {
        name:'page2',
        path:'page2',
        component:()=>import('@/pages/Main/Other/Page2')
      },
      // 重定向
      {
        path:'/',
        redirect:(to)=>'/home'
      },
    ]
  },
  {
    name:'login',
    path:'/login',
    component:()=>import('@/pages/Login')
  }
]